home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / ear / mui23dev.lha / MUI / Developer / C / Examples / DVIprint.c < prev    next >
C/C++ Source or Header  |  1994-12-23  |  31KB  |  810 lines

  1. /*
  2.  *            DVIprint MUI Demo
  3.  *                  =================
  4.  *
  5.  *  This is a preview demo of the new DVIprint of PasTeX 1.4.
  6.  *  This demo is absolutly *not functional*. It's only a demo
  7.  *  how easy it is to create a GUI with the help of MUI!
  8.  *
  9.  *  Georg Hessmann.
  10.  *
  11.  */
  12.  
  13. #include "demo.h"
  14.  
  15.  
  16. #define ID_ABOUT          1
  17. #define ID_NEWFILE        2
  18. #define ID_DOUBLENEWFILE    3
  19. #define ID_NEWVOLUME        4
  20. #define ID_MUTTER        5
  21. #define ID_DVIFILE        6
  22. #define ID_NEWPRT        7
  23. #define ID_RUNPRINT        8
  24. #define ID_CANCELPRINT        9
  25. #define ID_PRTUSE        10
  26. #define ID_PRTCANCEL        11
  27. #define ID_SONUSE        12
  28. #define ID_SONCANCEL        13
  29. #define ID_HOFF            14    /* check of richtige Massangabe */
  30. #define ID_VOFF            15    /* "" */
  31. #define ID_WIDTH        16    /* "" */
  32. #define ID_HEIGHT        17    /* "" */
  33.  
  34.  
  35. struct NewMenu Menu[] =
  36. {
  37.     { NM_TITLE, "Project"  , 0 ,0,0,(APTR)0            },
  38.     { NM_ITEM , "About..." ,"?",0,0,(APTR)ID_ABOUT     },
  39.     { NM_ITEM , NM_BARLABEL, 0 ,0,0,(APTR)0            },
  40.     { NM_ITEM , "Quit"     ,"Q",0,0,(APTR)MUIV_Application_ReturnID_Quit },
  41.     { NM_END  , NULL       , 0 ,0,0,(APTR)0            },
  42. };
  43.  
  44.  
  45.  
  46.  
  47.  
  48. /****************************************************/
  49.  
  50.  
  51.  
  52. int CurPrtNum = 0;
  53.  
  54.  
  55. APTR Applic = NULL;
  56. APTR WI_Main, WI_Printer, WI_Sonst, WI_PrtRun;
  57.  
  58. /*
  59.  * Objecte von: WI_Main
  60.  */
  61. APTR CY_Reihenf, CY_Orient, CY_SeitenM, CY_ZuDruck, CY_Seiten,
  62.             ST_von, ST_bis, ST_num, ST_Kopien;
  63. APTR TX_Drucker, BT_Drucker, BT_MiscPre;
  64. APTR LV_Files, LV_Volumes, BT_Parent, ST_File, IM_File;
  65. APTR BT_Cancel, BT_Print, BT_Save;
  66.  
  67. /*
  68.  * Objecte von: WI_Printer
  69.  */
  70. APTR LV_PrtLst, TX_Printer;
  71. APTR CY_DrModus, CY_Density, CY_Optimize, CY_Direct, CY_DevMode, CY_Output, ST_Output, IM_Output;
  72. APTR ST_HOffset, ST_VOffset, CY_PgSize, ST_Width, ST_Height, CY_Reso, ST_XReso, ST_YReso, CY_FormFeed;
  73. APTR BT_PRTuse, BT_PRTcancel;
  74.  
  75. /* 
  76.  * Objecte von: WI_Sonst
  77.  */
  78. APTR ST_FDir, ST_FMem, CY_BMem, ST_BMem, ST_Prio;
  79. APTR IM_PreL, IM_Mark, IM_Stat, IM_Acco, CH_Logf, IM_Logf, ST_Logf;
  80. APTR BT_SONuse, BT_SONcancel;
  81.  
  82. /* 
  83.  * Objecte von: WI_PrtRun
  84.  */
  85. APTR GA_Gauge, TX_PrtFile, BT_RUNcancel;
  86.  
  87.  
  88.  
  89.  
  90. static const char * CYA_Reihenf [] = { "vorwärts", "rückwärts", NULL };
  91. static const char * CYA_Orient  [] = { "Hochformat", "Querformat", NULL };
  92. static const char * CYA_SeitenM [] = { "logisch", "physikalisch", NULL };
  93. static const char * CYA_ZuDruck [] = { "durchgehend", "gerade Seiten", "ungerade Seiten", NULL };
  94. static const char * CYA_Seiten  [] = { "alle", "von/bis", NULL };
  95.  
  96. static const char * CYA_DrModus [] = { "HQ", "Draft", NULL };
  97. static const char * CYA_Density [] = { "den 1", "den 2", "den 3", "den 4", "den 5", "den 6", "den 7", NULL };
  98. static const char * CYA_Optimize[] = { "an", "aus", NULL };
  99. static const char * CYA_Direct  [] = { "hin und her", "nur hin", NULL };
  100. static const char * CYA_DevMode [] = { "normal", "schnell", NULL };
  101. static const char * CYA_Output  [] = { "Drucker", "PRT-File...", "IFF-File...", NULL };
  102. static const char * CYA_PgSize  [] = { "des DVI-Files", "vorab Definition", NULL };
  103. static const char * CYA_Reso    [] = { "des Druckers", "spezielle", NULL };
  104. static const char * CYA_FormFeed[] = { "ausführen", "unterdrücken", NULL };
  105.  
  106. static const char * CYA_BMem    [] = { "unbegrenzt", "maximal bis...", NULL };
  107.  
  108. static char * LVT_PrtLst[] = { "generic", "DeskJet", "CheapDJ", "LaserJet", "LaserJet4", "CanonLBP", "NecP6", NULL };
  109.  
  110.  
  111. static char DVIFileBuffer[512];
  112. static char DVIpattern[16];
  113.  
  114.  
  115.  
  116. /******************************************************/
  117.  
  118. #define POP_FILE    1
  119. #define POP_OUTP    2
  120. #define POP_LOGF    3
  121.  
  122.  
  123. #define PopupArg(ptr,obj,retimg,img,hook,arg)\
  124.     HGroup, GroupSpacing(1),\
  125.         Child, ptr=obj,\
  126.         Child, retimg = ImageObject,\
  127.             ImageButtonFrame,\
  128.             MUIA_Image_Spec          , img,\
  129.             MUIA_Image_FontMatchWidth, TRUE,\
  130.             MUIA_Image_FreeVert      , TRUE,\
  131.             MUIA_InputMode           , MUIV_InputMode_RelVerify,\
  132.             MUIA_Background          , MUII_BACKGROUND,\
  133.             End,\
  134.         TAG_IGNORE, retimg && ptr ? DoMethod(retimg,MUIM_Notify,MUIA_Pressed,FALSE,ptr,3,MUIM_CallHook,hook,arg) : 0,\
  135.         End
  136.  
  137.  
  138. SAVEDS ASM ULONG FilePopupFunc(REG(a0) struct Hook * hook, REG(a1) void * args, REG(a2) APTR obj)
  139. {
  140.   struct Window * window;
  141.   long l, t, w, h;
  142.   struct FileRequester * req;
  143.   char * buf, * cptr, * dir, * file;
  144.   int IsDir, GadType;
  145.   BPTR lock;
  146.   __aligned struct FileInfoBlock fib;
  147.   char device[50];
  148.   char * title = "";
  149.   
  150.   /* put our application to sleep while displaying the requester */
  151.   set(Applic,MUIA_Application_Sleep,TRUE);
  152.   
  153.   GadType = *((long *)args);    /* POP_#? */
  154.  
  155.   switch (GadType) {
  156.     case POP_FILE:
  157.       title = "Select DVI-File";
  158.       break;
  159.     case POP_OUTP:
  160.       title = "Select Output-File";
  161.       break;
  162.     case POP_LOGF:
  163.       title = "Select Logfile";
  164.       break;
  165.   }
  166.  
  167.   get(obj,MUIA_String_Contents,&buf);
  168.   strncpy(DVIFileBuffer, buf, sizeof(DVIFileBuffer)-1);
  169.   
  170.   IsDir = FALSE;
  171.   lock = Lock(DVIFileBuffer, ACCESS_READ);
  172.   if (lock) {
  173.     if (Examine(lock, &fib)) {
  174.       if (fib.fib_DirEntryType > 0) IsDir = TRUE;
  175.     }
  176.     UnLock(lock);
  177.   }
  178.  
  179.   if (IsDir) {
  180.     file = NULL;
  181.     dir  = DVIFileBuffer;
  182.   }
  183.   else {
  184.     cptr = strrchr(DVIFileBuffer, '/');
  185.     if (cptr) {
  186.       dir = DVIFileBuffer;
  187.       *cptr = '\0';
  188.       file  = cptr+1;
  189.     }
  190.     else {
  191.       cptr = strchr(DVIFileBuffer, ':');
  192.       if (cptr) {
  193.         strncpy(device, DVIFileBuffer, cptr-DVIFileBuffer+1);
  194.         device[cptr-DVIFileBuffer+1] = '\0';
  195.         dir  = device;
  196.         file = cptr+1;
  197.       }
  198.       else {
  199.         dir  = NULL;
  200.         file = DVIFileBuffer;
  201.       }
  202.     }
  203.   }
  204.   
  205.   /* get the calling objects window and position */
  206.   get(obj,MUIA_Window  ,&window);
  207.   get(obj,MUIA_LeftEdge,&l);
  208.   get(obj,MUIA_TopEdge ,&t);
  209.   get(obj,MUIA_Width   ,&w);
  210.   get(obj,MUIA_Height  ,&h);
  211.  
  212.   if (req=MUI_AllocAslRequestTags(ASL_FileRequest,TAG_DONE)) {
  213.     if (MUI_AslRequestTags(req,
  214.          ASLFO_Window         ,window,
  215.          ASLFO_PrivateIDCMP   ,TRUE,
  216.          ASLFO_TitleText      ,title,
  217.          ASLFO_InitialLeftEdge,window->LeftEdge + l,
  218.          ASLFO_InitialTopEdge ,window->TopEdge  + t+h,
  219.          ASLFO_InitialWidth   ,w,
  220.          ASLFO_InitialHeight  ,250,
  221.          ((GadType==POP_FILE) ? ASLFR_InitialPattern : TAG_IGNORE), "#?.dvi",
  222.          ((file)              ? ASLFR_InitialFile    : TAG_IGNORE), file,
  223.          ((dir)               ? ASLFR_InitialDrawer  : TAG_IGNORE), dir,
  224.          TAG_DONE)) {
  225.  
  226.        /* set the new contents for our string gadget */
  227.        strncpy(DVIFileBuffer, req->fr_Drawer, sizeof(DVIFileBuffer)-1);
  228.        AddPart(DVIFileBuffer, req->fr_File, sizeof(DVIFileBuffer)-1);
  229.        set(obj,MUIA_String_Contents,DVIFileBuffer);
  230.  
  231.        if (GadType == POP_FILE) {
  232.             set(LV_Files, MUIA_Dirlist_Directory, req->fr_Drawer);
  233.        }
  234.     }
  235.     MUI_FreeAslRequest(req);
  236.   }
  237.  
  238.   /* wake up our application again */
  239.   set(Applic,MUIA_Application_Sleep,FALSE);
  240.  
  241.   return(0);
  242. }
  243.  
  244.  
  245. static struct Hook FilePopupHook = {
  246.     {NULL, NULL},
  247.     (void *)FilePopupFunc,
  248.     NULL, NULL
  249. };
  250.  
  251.  
  252. /******************************************************/
  253.  
  254.  
  255.  
  256.  
  257. int main(int argc, char * argv[])
  258. {
  259.   init();
  260.  
  261.   /*InitVars(); */
  262.  
  263.  
  264.   { /* Homedirectory in String-Gadget */
  265.     BPTR lock;
  266.     lock = Lock("", ACCESS_READ);
  267.     if (lock) {
  268.       (void)NameFromLock(lock, DVIFileBuffer, sizeof(DVIFileBuffer)-1);
  269.       UnLock(lock);
  270.     }
  271.     else {
  272.       *DVIFileBuffer = '\0';
  273.     }
  274.   }
  275.  
  276.   (void)ParsePatternNoCase("#?.dvi", DVIpattern, 16);
  277.  
  278.  
  279.   Applic = ApplicationObject,
  280.         MUIA_Application_Title         , "DVIprint",
  281.         MUIA_Application_Version       , "$VER: DVIprint 0.5 (02.08.93)",
  282.         MUIA_Application_Copyright     , "Copyright ©1993, Georg Heßmann",
  283.         MUIA_Application_Author        , "Georg Heßmann",
  284.         MUIA_Application_Description   , "MUI DEMO-FrontEnd for DVIprint/PasTeX",
  285.         MUIA_Application_Base          , "DVIPRINT",
  286.         MUIA_Application_Menu          , Menu,
  287.         
  288.  
  289.         SubWindow,
  290.             WI_Printer = WindowObject,
  291.             MUIA_Window_Title , "DVIprint MUI-Demo",
  292.             MUIA_Window_ID, MAKE_ID('P','R','T','D'),
  293.  
  294.             WindowContents, VGroup, 
  295.                   Child, HGroup,
  296.                       Child, VGroup, GroupFrameT("Drucker"),
  297.                         Child, LV_PrtLst = ListviewObject,
  298.                         MUIA_Listview_Input, TRUE,
  299.                         MUIA_Listview_List, ListObject, InputListFrame,
  300.                         MUIA_List_AdjustWidth, TRUE, End,
  301.                      End,
  302.                   Child, TX_Printer = TextObject, TextFrame, MUIA_Background, MUII_TextBack, End,
  303.                   End,
  304.                       Child, ColGroup(2), GroupFrameT("Druck Parameter"),
  305.                         Child, KeyLabel1("Modus:", 'm'),          Child, CY_DrModus  = KeyCycle(CYA_DrModus, 'm'),
  306.                         Child, KeyLabel1("Druck Dichte:", 'd'),         Child, CY_Density  = KeyCycle(CYA_Density, 'd'),
  307.                                   Child, KeyLabel1("Optimierung:", 'o'),    Child, CY_Optimize = KeyCycle(CYA_Optimize,'o'),
  308.                         Child, Label2("Seitenposition"),             Child, ColGroup(2),
  309.                             Child, Label2("horiz.:"), Child, ST_HOffset = StringObject, MUIA_String_Accept, "1234567890.incmptdb", MUIA_String_MaxLen, 7, StringFrame, MUIA_ControlChar, 'h', End,
  310.                             Child, Label2("vert.:"), Child, ST_VOffset = StringObject, MUIA_String_Accept, "1234567890.incmptdb", MUIA_String_MaxLen, 7, StringFrame, MUIA_ControlChar, 'v', End,
  311.                             End,
  312.                                   Child, KeyLabel1("Ausgabe auf:", 'e'),    Child, CY_Output   = KeyCycle(CYA_Output,'e'),
  313.                                   Child, HSpace(0),                         Child, PopupArg(ST_Output, String("",100), IM_Output, MUII_PopFile, &FilePopupHook, POP_OUTP),
  314.                                   /*Child, VSpace(0),                         Child, VSpace(0), */
  315.                                   End,
  316.                       Child, ColGroup(2), GroupFrameT("sonstige Parameter"),
  317.                                   Child, KeyLabel1("Letzter FormFeed:", 'f'), Child, CY_FormFeed = KeyCycle(CYA_FormFeed,'f'),
  318.                                   Child, KeyLabel1("Druck Richtung:", 'r'), Child, CY_Direct   = KeyCycle(CYA_Direct,'r'),
  319.                                   Child, KeyLabel1("Device Modus:", 'v'),   Child, CY_DevMode  = KeyCycle(CYA_DevMode,'v'),
  320.                         Child, KeyLabel1("Seitengröße:", 'g'),    Child, CY_PgSize   = KeyCycle(CYA_PgSize,'g'),
  321.                         Child, HSpace(0),                         Child, HGroup,
  322.                                     Child, Label2("H:"), Child, ST_Width   = StringObject, MUIA_String_Accept, "1234567890.incmptdb", MUIA_String_MaxLen, 7, StringFrame, End,
  323.                                     Child, Label2("V:"), Child, ST_Height  = StringObject, MUIA_String_Accept, "1234567890.incmptdb", MUIA_String_MaxLen, 7, StringFrame, End,
  324.                                     End,
  325.                         Child, KeyLabel1("Auflösung:", 'l'),      Child, CY_Reso    = KeyCycle(CYA_Reso,'l'),
  326.                         Child, HSpace(0),                         Child, HGroup,
  327.                             Child, Label2("H:"), Child, ST_XReso = StringObject, MUIA_String_Accept, "1234567890", MUIA_String_MaxLen, 5, StringFrame, End,
  328.                             Child, Label2("V:"), Child, ST_YReso = StringObject, MUIA_String_Accept, "1234567890", MUIA_String_MaxLen, 5, StringFrame, End,
  329.                             End,
  330.                                   Child, VSpace(0),                         Child, VSpace(0),
  331.                       End,
  332.                 End,
  333.  
  334.                 Child, VSpace(2),
  335.  
  336.               Child, HGroup,
  337.                  Child, BT_PRTuse   = SimpleButton("Ben_utzen"),
  338.                  Child, HSpace(0),
  339.                  Child, HSpace(0),
  340.                  Child, HSpace(0),
  341.                  Child, HSpace(0),
  342.                  Child, BT_PRTcancel = SimpleButton("_Abbrechen"),
  343.                  End,
  344.               End,
  345.             End,
  346.  
  347.         SubWindow,
  348.             WI_Sonst = WindowObject,
  349.             MUIA_Window_Title , "DVIprint MUI-Demo",
  350.             MUIA_Window_ID, MAKE_ID('S','O','N','S'),
  351.  
  352.             WindowContents, VGroup, 
  353.               Child, HGroup, GroupFrameT("diverse Einstellungen"),
  354.                 Child, ColGroup(2),
  355.                   Child, Label2("zus. Font Verz.:"), Child, ST_FDir = String(NULL, 50),
  356.                   Child, Label2("Task Priorität:"),  Child, ST_Prio = StringObject, MUIA_String_Accept, "1234567890", MUIA_String_MaxLen, 4, StringFrame, End, 
  357.                   Child, HGroup, 
  358.                     Child, HSpace(0),
  359.                     Child, Label2("Logfile:"),
  360.                     Child, CH_Logf = CheckMark(FALSE),
  361.                     End,
  362.                   Child, PopupArg(ST_Logf, String("T:DVIprint.log",50), IM_Logf, MUII_PopFile, &FilePopupHook, POP_LOGF),
  363.                   Child, Label1("Bitmap Speicher:"), Child, CY_BMem = Cycle(CYA_BMem),
  364.                   Child, HSpace(0),                  Child, HGroup, Child, ST_BMem = StringObject, MUIA_String_Accept, "1234567890", MUIA_String_MaxLen, 9, StringFrame, End, Child, Label2("Bytes"), End,
  365.                   Child, Label2("Font Speicher:"),   Child, HGroup, Child, ST_FMem = StringObject, MUIA_String_Accept, "1234567890", MUIA_String_MaxLen, 9, StringFrame, End, Child, Label2("Bytes"), End,
  366.                   End,
  367.                 Child, HSpace(2),
  368.                             Child, ColGroup(2),
  369.                   Child, Label1("Fonts vorladen:"),      Child, IM_PreL = CheckMark(FALSE),
  370.                   Child, Label1("Fonts markieren:"),     Child, IM_Mark = CheckMark(FALSE),
  371.                   Child, Label1("ausführliches Logf.:"), Child, IM_Stat = CheckMark(FALSE),
  372.                   Child, Label1("Seiten Protokoll:"),    Child, IM_Acco = CheckMark(FALSE),
  373.                   End,
  374.                 End,
  375.  
  376.                 Child, VSpace(2),
  377.  
  378.               Child, HGroup,
  379.                  Child, BT_SONuse   = SimpleButton("Ben_utzen"),
  380.                  Child, HSpace(0),
  381.                  Child, HSpace(0),
  382.                  Child, HSpace(0),
  383.                  Child, HSpace(0),
  384.                  Child, BT_SONcancel = SimpleButton("_Abbrechen"),
  385.                  End,
  386.               End,
  387.             End,
  388.  
  389.  
  390.         SubWindow,
  391.             WI_PrtRun = WindowObject,
  392.             MUIA_Window_Title , "DVIprint MUI-Demo",
  393.             MUIA_Window_ID, MAKE_ID('P','R','U','N'),
  394.  
  395.             WindowContents, VGroup, MUIA_Background, MUII_SHINEBACK,
  396.               Child, VGroup, GroupFrameT("Ausdruck"),
  397.                 Child, TX_PrtFile = TextObject, TextFrame, MUIA_Background, MUII_TextBack, MUIA_Text_PreParse, "\33c\0338", End,
  398.                 Child, VSpace(2),
  399.                 Child, HGroup,
  400.                   Child, HSpace(0),
  401.                   Child, GA_Gauge = GaugeObject, GaugeFrame, MUIA_Gauge_Horiz, TRUE, MUIA_Weight, 300, End,
  402.                   Child, HSpace(0),
  403.                   End,
  404.                 End,
  405.               Child, VSpace(2),
  406.               Child, BT_RUNcancel = SimpleButton("_Abbruch"),
  407.               End,
  408.             End,
  409.  
  410.  
  411.         SubWindow,
  412.             WI_Main = WindowObject,
  413.             MUIA_Window_Title , "DVIprint MUI-Demo",
  414.             MUIA_Window_ID, MAKE_ID('M','A','I','N'),
  415.  
  416.                     WindowContents, VGroup, 
  417.               Child, TextObject, TextFrame, MUIA_Background, MUII_TextBack, MUIA_Text_Contents, "\33c\33b\0338DVIprint - PasTeX\33n\nwritten 1993 by Georg Heßmann\n(non functional, only a MUI demo)",  End,
  418.  
  419.                           Child, HGroup,
  420.                  Child, ColGroup(2), GroupFrameT("Ausdruck"),
  421.                     Child, Label1("Drucke Seiten:"),   Child, CY_Seiten  = KeyCycle(CYA_Seiten, 'p'),
  422.                     Child, HSpace(0),                  Child, ColGroup(4),
  423.                                                          Child, Label2("von:"), Child, ST_von = StringObject, MUIA_String_Accept, "1234567890", MUIA_String_MaxLen, 5, StringFrame, End,
  424.                                                          Child, Label2("bis:"), Child, ST_bis = StringObject, MUIA_String_Accept, "1234567890", MUIA_String_MaxLen, 5, StringFrame, End,
  425.                                                          End,
  426.                        Child, VSpace(1),                  Child, VSpace(1),
  427.                   Child, KeyLabel2("Anzahl Seiten:", 'a'), Child, HGroup, Child, ST_num    = StringObject, StringFrame, MUIA_Weight, 20, MUIA_String_Accept, "1234567890", MUIA_String_MaxLen, 5, End, Child, HSpace(0), End,
  428.                       Child, KeyLabel2("Anzahl Kopien:", 'n'), Child, HGroup, Child, ST_Kopien = StringObject, StringFrame, MUIA_String_Integer,  1, MUIA_Weight, 20, MUIA_String_Accept, "1234567890", MUIA_String_MaxLen, 5, End, Child, HSpace(0), End,
  429.                       Child, VSpace(1),                  Child, VSpace(1),
  430.                     Child, KeyLabel1("Seiten drucken:",'u'),  Child, CY_ZuDruck = KeyCycle(CYA_ZuDruck,'u'),
  431.                     Child, KeyLabel1("Reihenfolge:",   'f'),  Child, CY_Reihenf = KeyCycle(CYA_Reihenf,'f'),
  432.                     Child, KeyLabel1("Seitenmodus:",   't'),  Child, CY_SeitenM = KeyCycle(CYA_SeitenM,'t'),
  433.                     Child, KeyLabel1("Orientierung:",  'o'),  Child, CY_Orient  = KeyCycle(CYA_Orient ,'o'),
  434.                     Child, VSpace(0), Child, VSpace(0),
  435.                     End,
  436.  
  437.                   Child, VGroup,
  438.                               Child, VGroup, GroupFrameT("Einstellungen"),
  439.                     Child, TX_Drucker = TextObject, TextFrame, MUIA_Background, MUII_TextBack, MUIA_Text_PreParse, "\33c\33b", End,
  440.                     Child, HGroup,
  441.                                   Child, BT_Drucker = SimpleButton("Druck_er"),
  442.                                   Child, BT_MiscPre = SimpleButton("Sonsti_ges"),
  443.                                   End,
  444.                       End,
  445.                     Child, VGroup, GroupFrameT("DVI-File"),
  446.                 Child, HGroup,
  447.                     Child, LV_Files = ListviewObject,
  448.                             MUIA_Weight, 300,
  449.                             MUIA_Listview_Input, TRUE,
  450.                             MUIA_Listview_List, DirlistObject,
  451.                             InputListFrame,
  452.                             MUIA_Dirlist_Directory, DVIFileBuffer, 
  453.                             MUIA_Dirlist_AcceptPattern, DVIpattern,
  454.                             MUIA_Dirlist_RejectIcons, TRUE, End,
  455.                             End,
  456.                     Child, VGroup,
  457.                       Child, LV_Volumes = ListviewObject,
  458.                                 MUIA_Weight, 200,
  459.                                 MUIA_Listview_Input, TRUE,
  460.                                 MUIA_Listview_List, VolumelistObject, 
  461.                                 InputListFrame, End,
  462.                                 End,
  463.                       Child, BT_Parent = SimpleButton("_Mutter"),
  464.                       End,
  465.                     End,
  466.                       Child, PopupArg(ST_File, String(DVIFileBuffer,sizeof(DVIFileBuffer)), IM_File, MUII_PopFile, &FilePopupHook, POP_FILE),
  467.                       End,
  468.                     End,
  469.                   End,
  470.                 
  471.                 Child, VSpace(2),
  472.  
  473.                           Child, HGroup,
  474.                  Child, BT_Save   = SimpleButton("_Speichern"),
  475.                  Child, HSpace(0),
  476.                  Child, HSpace(0),
  477.                  Child, BT_Print  = SimpleButton("_Drucken"),
  478.                  Child, HSpace(0),
  479.                  Child, HSpace(0),
  480.                  Child, BT_Cancel = SimpleButton("_Abbrechen"),
  481.                  End,
  482.  
  483.                     End,
  484.         End,
  485.         
  486.        End;
  487.  
  488.  
  489.   if (!Applic) fail(Applic, "Failed to create application.");
  490.  
  491.  
  492.   /*
  493.   ** Ein paar Gadgets disable'n
  494.   */
  495.   set(ST_Output, MUIA_Disabled, TRUE);
  496.   set(IM_Output, MUIA_Disabled, TRUE);
  497.   DoMethod(CY_Output,MUIM_Notify,MUIA_Cycle_Active,0,ST_Output,3,MUIM_Set,MUIA_Disabled,TRUE);
  498.   DoMethod(CY_Output,MUIM_Notify,MUIA_Cycle_Active,0,IM_Output,3,MUIM_Set,MUIA_Disabled,TRUE);
  499.   DoMethod(CY_Output,MUIM_Notify,MUIA_Cycle_Active,1,ST_Output,3,MUIM_Set,MUIA_Disabled,FALSE);
  500.   DoMethod(CY_Output,MUIM_Notify,MUIA_Cycle_Active,1,IM_Output,3,MUIM_Set,MUIA_Disabled,FALSE);
  501.   DoMethod(CY_Output,MUIM_Notify,MUIA_Cycle_Active,2,ST_Output,3,MUIM_Set,MUIA_Disabled,FALSE);
  502.   DoMethod(CY_Output,MUIM_Notify,MUIA_Cycle_Active,2,IM_Output,3,MUIM_Set,MUIA_Disabled,FALSE);
  503.  
  504.   set(ST_Width,  MUIA_Disabled, TRUE);    /* in der Initialisierung geht es nicht */
  505.   set(ST_Height, MUIA_Disabled, TRUE);
  506.   DoMethod(CY_PgSize,MUIM_Notify,MUIA_Cycle_Active,0,ST_Width,3,MUIM_Set,MUIA_Disabled,TRUE);
  507.   DoMethod(CY_PgSize,MUIM_Notify,MUIA_Cycle_Active,0,ST_Height,3,MUIM_Set,MUIA_Disabled,TRUE);
  508.   DoMethod(CY_PgSize,MUIM_Notify,MUIA_Cycle_Active,1,ST_Width,3,MUIM_Set,MUIA_Disabled,FALSE);
  509.   DoMethod(CY_PgSize,MUIM_Notify,MUIA_Cycle_Active,1,ST_Height,3,MUIM_Set,MUIA_Disabled,FALSE);
  510.  
  511.   set(ST_XReso, MUIA_Disabled, TRUE);
  512.   set(ST_YReso, MUIA_Disabled, TRUE);
  513.   DoMethod(CY_Reso,MUIM_Notify,MUIA_Cycle_Active,0,ST_XReso,3,MUIM_Set,MUIA_Disabled,TRUE);
  514.   DoMethod(CY_Reso,MUIM_Notify,MUIA_Cycle_Active,0,ST_YReso,3,MUIM_Set,MUIA_Disabled,TRUE);
  515.   DoMethod(CY_Reso,MUIM_Notify,MUIA_Cycle_Active,1,ST_XReso,3,MUIM_Set,MUIA_Disabled,FALSE);
  516.   DoMethod(CY_Reso,MUIM_Notify,MUIA_Cycle_Active,1,ST_YReso,3,MUIM_Set,MUIA_Disabled,FALSE);
  517.   
  518.   set(ST_BMem, MUIA_Disabled, TRUE);
  519.   DoMethod(CY_BMem,MUIM_Notify,MUIA_Cycle_Active,0,ST_BMem,3,MUIM_Set,MUIA_Disabled,TRUE);
  520.   DoMethod(CY_BMem,MUIM_Notify,MUIA_Cycle_Active,1,ST_BMem,3,MUIM_Set,MUIA_Disabled,FALSE);
  521.   
  522.   set(IM_Logf, MUIA_Disabled, TRUE);
  523.   set(ST_Logf, MUIA_Disabled, TRUE);
  524.   DoMethod(CH_Logf,MUIM_Notify,MUIA_Selected,FALSE,IM_Logf,3,MUIM_Set,MUIA_Disabled,TRUE);
  525.   DoMethod(CH_Logf,MUIM_Notify,MUIA_Selected,FALSE,ST_Logf,3,MUIM_Set,MUIA_Disabled,TRUE);
  526.   DoMethod(CH_Logf,MUIM_Notify,MUIA_Selected,TRUE,IM_Logf,3,MUIM_Set,MUIA_Disabled,FALSE);
  527.   DoMethod(CH_Logf,MUIM_Notify,MUIA_Selected,TRUE,ST_Logf,3,MUIM_Set,MUIA_Disabled,FALSE);
  528.   
  529.   
  530.  
  531.  
  532.   /*
  533.   ** This one makes us receive input ids from several list views.
  534.   */
  535.  
  536.   DoMethod(LV_PrtLst,MUIM_Notify,MUIA_List_Active,MUIV_EveryTime,Applic,2,MUIM_Application_ReturnID,ID_NEWPRT);
  537.  
  538.  
  539.   /*
  540.   ** Now lets set the TAB cycle chain for some of our windows.
  541.   */
  542.  
  543.   DoMethod(WI_Main,MUIM_Window_SetCycleChain,CY_Seiten,ST_von,ST_bis,ST_num,ST_Kopien,CY_ZuDruck,CY_Reihenf,CY_SeitenM,CY_Orient,BT_Drucker,BT_MiscPre,ST_File,IM_File,LV_Files,BT_Parent,LV_Volumes,NULL);
  544.   DoMethod(WI_Printer,MUIM_Window_SetCycleChain,LV_PrtLst,CY_DrModus,CY_Density,CY_Optimize,ST_HOffset,ST_VOffset,CY_Output,ST_Output,IM_Output,CY_FormFeed,CY_Direct,CY_DevMode,CY_PgSize,ST_Width,ST_Height,CY_Reso,ST_XReso,ST_YReso,NULL);
  545.   DoMethod(WI_Sonst,MUIM_Window_SetCycleChain,ST_FDir,ST_Prio,CH_Logf,ST_Logf,IM_Logf,CY_BMem,ST_BMem,ST_FMem,IM_PreL,IM_Mark,IM_Stat,IM_Acco,NULL);
  546.   
  547.   DoMethod(ST_von, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, WI_Main, 3, MUIM_Set, MUIA_Window_ActiveObject, ST_bis);
  548.   DoMethod(ST_bis, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, WI_Main, 3, MUIM_Set, MUIA_Window_ActiveObject, ST_num);
  549.   DoMethod(ST_num, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, WI_Main, 3, MUIM_Set, MUIA_Window_ActiveObject, ST_Kopien);
  550.   DoMethod(ST_Kopien, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, WI_Main, 3, MUIM_Set, MUIA_Window_ActiveObject, CY_ZuDruck);
  551.  
  552.   DoMethod(ST_von, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, CY_Seiten, 3, MUIM_Set, MUIA_Cycle_Active, 1);
  553.   DoMethod(ST_bis, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, CY_Seiten, 3, MUIM_Set, MUIA_Cycle_Active, 1);
  554.  
  555.   DoMethod(CY_Seiten, MUIM_Notify, MUIA_Cycle_Active, 0, ST_von, 3, MUIM_Set, MUIA_String_Contents, NULL);
  556.   DoMethod(CY_Seiten, MUIM_Notify, MUIA_Cycle_Active, 0, ST_bis, 3, MUIM_Set, MUIA_String_Contents, NULL);
  557.   DoMethod(CY_Seiten, MUIM_Notify, MUIA_Cycle_Active, 1, WI_Main, 3, MUIM_Set, MUIA_Window_ActiveObject, ST_von);
  558.  
  559.   DoMethod(ST_HOffset, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, WI_Printer, 3, MUIM_Set, MUIA_Window_ActiveObject, ST_VOffset);
  560.   DoMethod(ST_VOffset, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, WI_Printer, 3, MUIM_Set, MUIA_Window_ActiveObject, CY_Output);
  561.   DoMethod(ST_Width, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, WI_Printer, 3, MUIM_Set, MUIA_Window_ActiveObject, ST_Height);
  562.   DoMethod(ST_Height, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, WI_Printer, 3, MUIM_Set, MUIA_Window_ActiveObject, CY_Reso);
  563.   DoMethod(ST_XReso, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, WI_Printer, 3, MUIM_Set, MUIA_Window_ActiveObject, ST_YReso);
  564.   DoMethod(ST_YReso, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, WI_Printer, 3, MUIM_Set, MUIA_Window_ActiveObject, LV_PrtLst);
  565.  
  566.  
  567.  /*
  568.   ** Lets bind the sub windows to the corresponding button
  569.   ** of the master window.
  570.   */
  571.  
  572.   DoMethod(BT_Drucker,MUIM_Notify,MUIA_Pressed,FALSE,WI_Printer,3,MUIM_Set,MUIA_Window_Open,TRUE);
  573.   DoMethod(BT_MiscPre,MUIM_Notify,MUIA_Pressed,FALSE,WI_Sonst,3,MUIM_Set,MUIA_Window_Open,TRUE);
  574.   DoMethod(BT_Print,MUIM_Notify,MUIA_Pressed,FALSE,Applic,2,MUIM_Application_ReturnID,ID_RUNPRINT);
  575.  
  576.   DoMethod(BT_PRTuse,MUIM_Notify,MUIA_Pressed,FALSE,Applic,2,MUIM_Application_ReturnID,ID_PRTUSE);
  577.   DoMethod(BT_SONuse,MUIM_Notify,MUIA_Pressed,FALSE,Applic,2,MUIM_Application_ReturnID,ID_SONUSE);
  578.  
  579.   DoMethod(BT_PRTcancel,MUIM_Notify,MUIA_Pressed,FALSE,          Applic,2,MUIM_Application_ReturnID,ID_PRTCANCEL);
  580.   DoMethod(BT_SONcancel,MUIM_Notify,MUIA_Pressed,FALSE,          Applic,2,MUIM_Application_ReturnID,ID_SONCANCEL);
  581.   DoMethod(WI_Printer,MUIM_Notify,MUIA_Window_CloseRequest,TRUE, Applic,2,MUIM_Application_ReturnID,ID_PRTCANCEL);
  582.   DoMethod(WI_Sonst,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,   Applic,2,MUIM_Application_ReturnID,ID_SONCANCEL);
  583.  
  584.  
  585.   /*
  586.   ** This one makes us receive input ids from several list views.
  587.   */
  588.  
  589.   DoMethod(LV_Volumes ,MUIM_Notify,MUIA_Listview_DoubleClick,TRUE,Applic,2,MUIM_Application_ReturnID,ID_NEWVOLUME);
  590.   DoMethod(LV_Files,MUIM_Notify,MUIA_List_Active,MUIV_EveryTime,Applic,2,MUIM_Application_ReturnID,ID_NEWFILE);
  591.   DoMethod(LV_Files,MUIM_Notify,MUIA_Listview_DoubleClick,TRUE,Applic,2,MUIM_Application_ReturnID,ID_DOUBLENEWFILE);
  592.   DoMethod(BT_Parent,MUIM_Notify,MUIA_Pressed,FALSE,Applic,2,MUIM_Application_ReturnID,ID_MUTTER);
  593.   DoMethod(ST_File,MUIM_Notify,MUIA_String_Acknowledge, MUIV_EveryTime,Applic,2,MUIM_Application_ReturnID,ID_DVIFILE);
  594.  
  595.   DoMethod(LV_PrtLst,MUIM_Notify,MUIA_List_Active,MUIV_EveryTime,Applic,2,MUIM_Application_ReturnID,ID_NEWPRT);
  596.  
  597.  
  598.   DoMethod(ST_HOffset, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, Applic, 2, MUIM_Application_ReturnID, ID_HOFF);
  599.   DoMethod(ST_VOffset, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, Applic, 2, MUIM_Application_ReturnID, ID_VOFF);
  600.   DoMethod(ST_Width,   MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, Applic, 2, MUIM_Application_ReturnID, ID_WIDTH);
  601.   DoMethod(ST_Height,  MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, Applic, 2, MUIM_Application_ReturnID, ID_HEIGHT);
  602.  
  603.  
  604.  
  605.  /*
  606.   ** Automagically remove a window when the user hits the close gadget.
  607.   */
  608.  
  609.   DoMethod(WI_PrtRun,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,  Applic,2,MUIM_Application_ReturnID,ID_CANCELPRINT);
  610.  
  611.  
  612.   /*
  613.   ** Closing the master window forces a complete shutdown of the application.
  614.   */
  615.  
  616.   DoMethod(WI_Main,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,Applic,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit);
  617.   DoMethod(BT_Cancel,MUIM_Notify,MUIA_Pressed,FALSE,Applic,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit);
  618.   
  619.   DoMethod(WI_Main,    MUIM_Notify,MUIA_Window_InputEvent, "control c", Applic,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit);
  620.   DoMethod(WI_Sonst,   MUIM_Notify,MUIA_Window_InputEvent, "control c", Applic,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit);
  621.   DoMethod(WI_Printer, MUIM_Notify,MUIA_Window_InputEvent, "control c", Applic,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit);
  622.  
  623.  
  624.  
  625.   /*
  626.   ** Set some start values for certain objects.
  627.   */
  628.  
  629.  
  630.   
  631.   set(TX_PrtFile,MUIA_Text_Contents,"work:diplo/maus.dvi");
  632.   
  633.   /* WI_Main mit defaults belegen */
  634.   /*SetupWIMAIN(); */
  635.   DoMethod(LV_PrtLst,MUIM_List_Insert,LVT_PrtLst,-1,MUIV_List_Insert_Bottom);
  636.   
  637.   set(TX_Drucker, MUIA_Text_Contents, "DeskJet 300 dpi");
  638.   CurPrtNum = 1;
  639.   set(LV_PrtLst, MUIA_List_Active, CurPrtNum);
  640.  
  641.   /*SetupWIPRINTER(); */
  642.  
  643.   /*UsePrinter(CurPrtNum); */
  644.  
  645.     
  646.   /*
  647.   ** Everything's ready, lets launch the application. We will
  648.   ** open the master window now.
  649.   */
  650.  
  651.   set(WI_Main,MUIA_Window_Open,TRUE);
  652.  
  653.   {
  654.     ULONG signal, retsig;
  655.     BOOL running = TRUE;
  656.     char * buf, * cptr;
  657.     BPTR lock;
  658.     __aligned struct FileInfoBlock * pfib;
  659.     int id;
  660.  
  661.     while (running) {
  662.       id = DoMethod(Applic,MUIM_Application_Input,&signal);
  663.       switch (id) {
  664.         case MUIV_Application_ReturnID_Quit:
  665.          running = FALSE;
  666.           break;
  667.  
  668.         case ID_ABOUT:
  669.           MUI_Request(Applic, WI_Main, 0, NULL, "OK", "DVIprint MUI-Demo\n© 1993 by Georg Heßmann");
  670.           break;
  671.  
  672.         case ID_NEWFILE:
  673.              get(LV_Files,MUIA_Dirlist_Path, &buf);
  674.             if (buf) {
  675.             strncpy(DVIFileBuffer, buf, sizeof(DVIFileBuffer)-1);
  676.                   set(ST_File,MUIA_String_Contents,DVIFileBuffer);
  677.         }
  678.         break;
  679.  
  680.       case ID_DOUBLENEWFILE:
  681.         DoMethod(LV_Files,MUIM_List_GetEntry,-1,&pfib);
  682.              get(LV_Files,MUIA_Dirlist_Path, &buf);
  683.             strncpy(DVIFileBuffer, buf, sizeof(DVIFileBuffer)-1);
  684.               set(ST_File,MUIA_String_Contents,DVIFileBuffer);
  685.         if (pfib->fib_DirEntryType > 0) {
  686.           set(LV_Files,MUIA_Dirlist_Directory,buf);
  687.         }
  688.         break;
  689.  
  690.       case ID_NEWVOLUME:
  691.         DoMethod(LV_Volumes,MUIM_List_GetEntry,-1,&buf);
  692.         set(LV_Files,MUIA_Dirlist_Directory,buf);
  693.         break;
  694.  
  695.       case ID_MUTTER:
  696.         DoMethod(LV_Files,MUIM_List_GetEntry,-1,&pfib);
  697.               get(ST_File,MUIA_String_Contents,&buf);
  698.             strncpy(DVIFileBuffer, buf, sizeof(DVIFileBuffer)-1);
  699.               cptr = strrchr(DVIFileBuffer, '/');
  700.         if (pfib->fib_DirEntryType < 0 && cptr) {
  701.           *cptr = '\0';
  702.           cptr = strrchr(DVIFileBuffer, '/');
  703.         }
  704.               if (!cptr) cptr = strchr(DVIFileBuffer, ':');
  705.               if (cptr) {
  706.                   if (*cptr == ':') cptr++;
  707.                 *cptr = '\0';
  708.               }
  709.               set(ST_File,MUIA_String_Contents,DVIFileBuffer);
  710.         set(LV_Files,MUIA_Dirlist_Directory,DVIFileBuffer);
  711.         break;
  712.  
  713.       case ID_DVIFILE:
  714.               get(ST_File,MUIA_String_Contents,&buf);
  715.             lock = Lock(buf, ACCESS_READ);
  716.             if (!lock) {
  717.                  set(ST_File,MUIA_String_Contents,DVIFileBuffer);
  718.             }
  719.             else {
  720.               UnLock(lock);
  721.               lock = NULL;
  722.               strncpy(DVIFileBuffer, buf, sizeof(DVIFileBuffer)-1);
  723.               set(LV_Files, MUIA_Dirlist_Directory, DVIFileBuffer);
  724.             }
  725.             break;
  726.  
  727.       case ID_NEWPRT:
  728.         get(LV_PrtLst,MUIA_List_Active,&CurPrtNum);
  729.         set(TX_Printer,MUIA_Text_Contents,LVT_PrtLst[CurPrtNum]);
  730.         /*SetPrinterTo(CurPrtNum); */
  731.         break;
  732.  
  733.       case ID_PRTUSE:        /* Use Druckereinstellfenster */
  734.             if (TRUE /*CheckPrinter()*/) {
  735.               /* all values correct? */
  736.               /* wenn nicht dann bleibt das Fenster offen und der erste falsche Wert wird aktiv */
  737.           /*UsePrinter(CurPrtNum); */
  738.           set(WI_Printer,MUIA_Window_Open,FALSE);
  739.         }
  740.         break;
  741.  
  742.       case ID_PRTCANCEL:        /* Cancel Druckereinstellfenster */
  743.             set(WI_Printer,MUIA_Window_Open,FALSE);
  744.         /*SetupWIPRINTER(); */
  745.         break;
  746.  
  747.       case ID_SONUSE:        /* Use Sonstiges Einstellfenster */
  748.         set(WI_Sonst,MUIA_Window_Open,FALSE);
  749.         break;
  750.       
  751.       case ID_SONCANCEL:
  752.             set(WI_Sonst,MUIA_Window_Open,FALSE);
  753.           break;
  754.  
  755.       case ID_RUNPRINT:        /* Starte Ausdruck */
  756.         set(WI_Main,MUIA_Window_Sleep,TRUE);
  757.         set(WI_Printer,MUIA_Window_Sleep,TRUE);
  758.         set(WI_Sonst,MUIA_Window_Sleep,TRUE);
  759.         set(WI_PrtRun,MUIA_Window_Open,TRUE);
  760.         break;
  761.  
  762.       case ID_CANCELPRINT:        /* Stoppe Ausdruck */
  763.         set(WI_Main,MUIA_Window_Sleep,FALSE);
  764.         set(WI_Printer,MUIA_Window_Sleep,FALSE);
  765.         set(WI_Sonst,MUIA_Window_Sleep,FALSE);
  766.         set(WI_PrtRun,MUIA_Window_Sleep,FALSE);
  767.         set(WI_PrtRun,MUIA_Window_Open,FALSE);
  768.         break;
  769.  
  770.       case ID_HOFF:            /* 'nutzer hat in ST_HOffset... Return geklickt */
  771.       case ID_VOFF:
  772.       case ID_WIDTH:
  773.       case ID_HEIGHT:
  774.             /* Test ob korrekter Wert... */
  775.             {
  776.               /*int i; */
  777.               /*float f; */
  778.               APTR obj;
  779.               
  780.                 switch (id) {
  781.                 case ID_HOFF:    obj = ST_HOffset; break;
  782.                 case ID_VOFF:    obj = ST_VOffset; break;
  783.                 case ID_WIDTH:    obj = ST_Width;      break;
  784.                 case ID_HEIGHT:    obj = ST_Height;  break;
  785.               }
  786.                 get(obj,MUIA_String_Contents,&buf);
  787.               if (FALSE /*dimen_to_inch(buf, &f, &i)*/) {    /* test for correct TeX dimension */
  788.                 /* ist kein richtiger Offset! */
  789.                 set(WI_Printer, MUIA_Window_ActiveObject, obj);
  790.               }
  791.             }
  792.             break;
  793.       }
  794.       if (signal)
  795.     {
  796.     retsig = Wait(signal | SIGBREAKF_CTRL_C);
  797.     if (retsig & SIGBREAKF_CTRL_C) running = FALSE;
  798.     }
  799.     }
  800.   }
  801.  
  802.  
  803.   /*
  804.   ** Call the fail function in demos.h, this will dispose the
  805.   ** application object and close "muimaster.library".
  806.   */
  807.  
  808.   fail(Applic,NULL);
  809. }
  810.